A two-dimensional (2D) code, also known as a 2D barcode, or a quick response (QR) code can record data symbol information by using a bar and space alternating graph formed by a particular type of geometric graphs distributed on a 2D plane according to a particular rule. The 2D code has features including a large information capacity, a wide coding range, strong error tolerance, and high decoding reliability. 2D codes are also low-cost and easy to produce. As a result, 2D codes are widely used in people's lives.
With the development of the Internet and popularization of mobile devices, 2D codes can be seen everywhere in daily life. For example, a merchant can post a payment 2D code at a checkout, and a user can scan the payment 2D code by using a 2D code scanning function in an application. Or, in commodity promotion, a merchant can post an application downloading 2D code at relatively crowded places (such as a metro or a shopping mall), to attract people passing by to scan the 2D code and to download the application. Therefore, merchants or third parties need to provide authentic and valid 2D codes for users, and the users need an effective way to verify the 2D codes.
Currently, there is a risk that a 2D code printed by a merchant could be unknowingly replaced. However, as 2D codes are abstract, it is difficult for the merchant to recognize a replacement with the naked eye. The merchant could use a camera of a mobile phone or other device to determine whether the 2D code has been replaced. However, the mobile phone needs to access a network for a 2D code scan and determination. What is needed is the ability to verify the validity of a 2D code without a network connection.
The information above is merely presented as background information to help understand the present disclosure.